package com.ruofeng.app.privilege.resource

import com.fasterxml.jackson.databind.ObjectMapper
import org.beetl.sql.core.SQLManager
import org.junit.Test
import org.junit.runner.RunWith
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.boot.test.context.SpringBootTest
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner


/**
 * Created by 邱鹏 on 2017/8/16.
 */
@RunWith(SpringJUnit4ClassRunner::class)
@SpringBootTest
class ResourceServiceTest {
    @Autowired
    lateinit var sqlManagerFactoryBean: SQLManager
    @Autowired
    lateinit var jsonObjectMapper: ObjectMapper
    @Autowired
    lateinit var service: ResourceService

    @Test
    fun getResourceDao() {
        var resource = Resource(0)
        resource.category="menu"
        var list=service.getResourceTree(resource)
        var str=jsonObjectMapper.writeValueAsString(list)
        println(str)

    }

    @Test
    fun getResource() {
    }

}